package exception;

public class ThrowsDemo {
    public static void main(String[] args){
        Student student = new Student();
        try {
            student.setAge(-1);
        } catch (IllegalAgeException e) {
//            e.printStackTrace();
            System.out.println(e.getMessage());
        }
        System.out.println(student.getAge());

    }
}
